package com.ty.feignclients;

import com.ty.dto.Order;
import com.ty.dto.OrderQuery;
import com.ty.dto.OrderingDto;
import com.ty.dto.OrderingOk;
import com.ty.config.FeignConfig;
import com.ty.service.IOderService;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.cloud.openfeign.SpringQueryMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;


import java.util.List;

@FeignClient(name = "user-service")
public interface OrderServiceClient extends IOderService {
    @PostMapping("/api/order")
    OrderingOk ordering(@RequestBody OrderingDto dto);

    @GetMapping("/api/order")
    List<Order> select(@SpringQueryMap OrderQuery query);

    @GetMapping("/api/order/sleep")
    String sleep (@RequestParam Integer time) ;
}

